﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Studio77_GuessTheWordsForWP7_Views="clr-namespace:Studio77.GuessTheWordsForWP7.Views" 
    xmlns:UI="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" 
    x:Class="Studio77.GuessTheWordsForWP7.GamePage"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="ButtonStylePause" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FFFFF72B" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FFFFF72B" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path1" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FF5E0000" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FFAFAFAF" Storyboard.TargetProperty="(Shape.Stroke).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FFE2E2E2" Storyboard.TargetProperty="(Shape.Stroke).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="1.027" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="1.027" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="-1.5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="1.5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Ellipse x:Name="ellipse" StrokeThickness="5" Fill="#FF4E0000" Margin="0" RenderTransformOrigin="0.5,0.5">
                                <Ellipse.RenderTransform>
                                    <CompositeTransform/>
                                </Ellipse.RenderTransform>
                                <Ellipse.Stroke>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.082,0.553">
                                        <GradientStop Color="#FFA78307" Offset="0"/>
                                        <GradientStop Color="#FFC49859" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Stroke>
                            </Ellipse>
                            <Path x:Name="path" Data="M-1.6667951,-0.33333334 L8,0 L8,28 L0,28 z" Fill="White" HorizontalAlignment="Left" Margin="23.332,0,0,22.006" Stretch="Fill" StrokeThickness="5" Width="9.665" UseLayoutRounding="False" Height="28.333" VerticalAlignment="Bottom" />
                            <Path x:Name="path1" Data="M-1.6667951,-0.33333334 L8,0 L8,28 L0,28 z" Fill="White" HorizontalAlignment="Left" Margin="41.332,0,0,22.006" Stretch="Fill" StrokeThickness="5" Width="9.665" UseLayoutRounding="False" Height="28.333" VerticalAlignment="Bottom" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleContinue" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FF42522C" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FF273119" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="border" BorderBrush="White" BorderThickness="1" CornerRadius="25">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF657E44" Offset="0.009"/>
                                        <GradientStop Color="#FF45562C" Offset="0.987"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleRestart" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FF703840" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FF54292F" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="border" BorderBrush="White" BorderThickness="1" CornerRadius="25">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFB25A66" Offset="0.009"/>
                                        <GradientStop Color="#FF6C373E" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonMainUI" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FF2F4358" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FF182533" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="border" BorderBrush="White" BorderThickness="1" CornerRadius="25">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF476587" Offset="0.009"/>
                                        <GradientStop Color="#FF2C4056" Offset="0.987"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>
    <Viewbox>

        <Grid x:Name="LayoutRoot" Background="Transparent" Height="800" Width="480">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="463"/>
                <RowDefinition Height="150"/>
                <RowDefinition Height="80"/>
            </Grid.RowDefinitions>
            <Image Grid.RowSpan="4" Source="Images/gamebackground.jpg" Stretch="Fill"/>
            <Border Width="444" BorderBrush="Black" BorderThickness="2" Grid.Row="1" d:LayoutOverrides="GridBox" HorizontalAlignment="Center" VerticalAlignment="Center" Height="444" >
                <Canvas x:Name="cvsBlocks"/>
            </Border>
            <ScrollViewer Margin="8,5">
                <StackPanel Orientation="Vertical">
                    <TextBlock x:Name="txtHorizonTip" TextWrapping="Wrap" Foreground="#FFFFE38E"/>
                    <TextBlock x:Name="txtVerticalTip" TextWrapping="Wrap" Foreground="#FFD4EA7C"/>
                </StackPanel>
            </ScrollViewer>
            <Studio77_GuessTheWordsForWP7_Views:VisualKeyBoard x:Name="keyboard" Grid.Row="2"/>
            <Border Grid.Row="3" Background="#35E0E0E0" >
                <Image Source="Images/logo77.png" Stretch="Fill" Width="156" Height="44"/>
            </Border>
            <Grid x:Name="gridMask" Grid.RowSpan="3" Margin="0,0,0,4">
                <Image Source="Images/gamebackground.jpg" Stretch="Fill"/>
                <Border BorderBrush="Black">
                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="关卡载入中..." VerticalAlignment="Center" FontSize="26.667" Foreground="White" Margin="165,0,164,0"/>
                		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Tip: 输入答案的汉字拼音首字母完成游戏" VerticalAlignment="Center" FontSize="24" Foreground="White" Margin="0,20,0,0"/>
                	</StackPanel>
                </Border>
            </Grid>
            <Border x:Name="bdrShowTip" BorderBrush="#FF9D0000" BorderThickness="2" Grid.Row="1" CornerRadius="10" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0.66" IsHitTestVisible="False" Padding="10,5" Visibility="Collapsed">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFFFAF00" Offset="0.009"/>
                        <GradientStop Color="#FFFFD200" Offset="1"/>
                        <GradientStop Color="#FEFFCD85" Offset="0.289"/>
                    </LinearGradientBrush>
                </Border.Background>
                <Grid>
                    <TextBlock x:Name="txtTipName" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" Text="再接再厉" VerticalAlignment="Center" Foreground="Black" FontSize="29.333"/>
                </Grid>
            </Border>
            <Border x:Name="bdrPause" BorderThickness="0" CornerRadius="10" Grid.RowSpan="4" Background="#CC000000" Visibility="Collapsed">
                <Grid>
                    <TextBlock x:Name="txtPauseCurrentStageName" TextWrapping="Wrap" Text="关卡-77" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,66,0,0" FontSize="48" Foreground="White"/>
                    <StackPanel Margin="0,200,0,318" Orientation="Vertical" HorizontalAlignment="Center">
                        <Button x:Name="btnPauseContinue" Click="btnPauseContinue_Click" Content="继续游戏" Height="50" Style="{StaticResource ButtonStyleContinue}" Width="250" HorizontalAlignment="Center" Background="Transparent" Foreground="White"/>
                        <Button x:Name="btnPauseReturn" Click="btnPauseReturn_Click" Content="返回菜单" Height="50" Style="{StaticResource ButtonMainUI}" Width="250" HorizontalAlignment="Center" Margin="0,50,0,0" Background="Transparent" Foreground="White"/>
                        <Button x:Name="btnPauseClearStageData" Click="btnPauseClearStageData_Click" Content="重玩本关" Style="{StaticResource ButtonStyleRestart}" Width="250" HorizontalAlignment="Center" Height="50" Margin="0,50,0,0" Background="Transparent" Foreground="White"/>
                    </StackPanel>
                    <StackPanel Margin="0,0,0,150" Orientation="Vertical" VerticalAlignment="Bottom" HorizontalAlignment="Center">
                        <TextBlock x:Name="txtPauseCompleteInfo" TextWrapping="Wrap" Text="完成情况：0/24" HorizontalAlignment="Center" FontSize="29.333" Foreground="White"/>
                        <TextBlock x:Name="txtPauseTime" TextWrapping="Wrap" Text="累计用时：0'02" HorizontalAlignment="Center" FontSize="29.333" Margin="0,10,0,0" Foreground="White"/>
                        <TextBlock x:Name="txtPauseScore" TextWrapping="Wrap" Text="得分：0" HorizontalAlignment="Center" FontSize="29.333" Margin="0,10,0,0" Foreground="White"/>
                    </StackPanel>
                </Grid>
            </Border>
            <Image x:Name="imgBanner" Margin="0,1,0,-1" Grid.Row="3" Source="/Images/banner1.jpg" Stretch="Fill" Tap="imgBanner_Tap"/>
            <UI:AdControl x:Name="adControlMicrosoft" ApplicationId="d9dc8a6a-817f-4c76-979e-b654c6b42479" AdUnitId="123675" HorizontalAlignment="Left" Height="80" Margin="0" Grid.Row="3" VerticalAlignment="Top" Width="480"/>
            <Grid Grid.Row="3" x:Name="gridMsnAd" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,8"/>
        </Grid>
    </Viewbox>
</phone:PhoneApplicationPage>
